package br.uvv.sao.util;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public class MsgUtil {
	public static void msgInfo(String str){
		FacesContext contexto = FacesContext.getCurrentInstance();
		contexto.getExternalContext().getFlash().setKeepMessages(true);  
		contexto.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,str,null));
	}

	public static void msgWarn(String str){
		FacesContext contexto = FacesContext.getCurrentInstance();
		contexto.getExternalContext().getFlash().setKeepMessages(true);  
		contexto.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN,str,null));
	}

	public static void msgError(String str){
		FacesContext contexto = FacesContext.getCurrentInstance();
		contexto.getExternalContext().getFlash().setKeepMessages(true);  
		contexto.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR,str,null));
	}

	public static void msgFatal(String str){
		FacesContext contexto = FacesContext.getCurrentInstance();
		contexto.getExternalContext().getFlash().setKeepMessages(true);  
		contexto.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL,str,null));
	}
}
